﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<VietImage.Models.Category>" %>
<%@ Register Src="~/Views/Category/PhotoEssay.ascx" TagName="photoessay" TagPrefix="uc" %>
<%@ Register Src="~/Views/Shared/HomeSearch.ascx" TagName="homesearch" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Phóng sự ảnh
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<link href="/Content/scroller.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/scroller.js"></script>
<script src="/Scripts/reflection.js"></script>
<script>
    $(document).ready(function (e) {
        $("body").css("min-width", "1120px");
        $(".headermenu_item a").eq(1).addClass("active");
        createScollerx("categoryscroller");
    });
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%
    int lang = 2;    
 %>
<div id="categorymenu">
    <div id="direction">
        <div class="rightarrow"></div>
        <div><%= Html.ActionLink("THƯ VIỆN ẢNH","Index","Category") %></div>
        <div class="rightarrow"></div>
        <div><%= Html.ActionLink("PHÓNG SỰ ẢNH","ReportageBrowse","Category") %></div>
    </div>
    <uc:homesearch runat="server" />
	<div class="clear"></div>
</div>


<div id="categorylist">
    <div id="categoryscroller" class="scrollerx scroller">
        <div class="scrollbar">
            <div class="scrollbar_end"></div>
            <div class="scrollbar_thumb"><div class="scrollbar_thumb_end"></div></div>
        </div>
        <div class="scroller_view" style="height: 524px; width: 972px;">

<% 
    int count = 0;
    List<VietImage.Models.Category> lst = Model.Children;
    if (lst != null)
    {
        count = lst.Count;
    }
    else
    {
        lst = VietImage.Models.Category.GetListAvailableParentCategories();
        if (lst != null)
        {
            count = lst.Count;
        }
        else
        {
            lst = new List<VietImage.Models.Category>();
        }
    }
    Double h = ((Double)count / 2) + 0.5;
    int itemwidth = 500;
    int half = (int)h;
%>
            <div class="scroller_panel" style="width: <%= half * itemwidth %>px">
<%
    for (int i = 0; i < count; )
    {
        essay1.ViewData["Parent"] = Model;
        essay1.ViewData["Category"] = lst[i++];
%>
                <div class="categorylistcolumn">
                    <uc:photoessay ID="essay1" runat="server" />
<%
        if (i < count)
        {
            essay2.ViewData["Parent"] = Model;
            essay2.ViewData["Category"] = lst[i++];
%>
                    <uc:photoessay ID="essay2" runat="server" />
<%
        } 
%>
                </div>
<%
    }
%>

                <div class="clear"></div>

            </div>
        </div>
    </div>
	<div class="clear"></div>
</div>
</asp:Content>
